package com.hoas.quickstart.threads.chapter05.chapter05_1_2;

import java.util.Calendar;
import java.util.Date;
import java.util.Timer;

public class Test4 {

    public static void main(String[] args) {
        System.out.println(" 当前时间为： " + new Date());
        Calendar calendarRef = Calendar.getInstance();
        Date runDate = calendarRef.getTime();
        System.out.println("计划的时间为：" + runDate);
        MyTaskB task = new MyTaskB();
        MyTask task1 = new MyTask();

        Timer timer = new Timer();
        timer.schedule(task, runDate, 4000);
        timer.schedule(task1, runDate, 4000);
    }

}
